<?php
	$path_one = 'admin/admin_project';
	$path_two = 'admin/admin_project_manage';
	$filename = 'admin/admin_project_add';
	require_once("header.php");
	require_once("admin_comm.php");
	require_once $_site->get_handlepath('project');
	require_once $_site->get_handlepath('admin');
	$id= request('id',false,true);
	$result = project_fun_get_project_info($id);
	$admin_list = admin_fun_list(array('group'=>10,'state'=>1));//获取项目管理员列表
?>
<script type="text/javascript" charset="utf-8">
	
	loader.file({
		plugin:['validform/main','dialog/main','my97/wdatepicker'],
		skincss:['list']
	})
	$(document).ready(function(){
		
		var form_obj=$("#form1").Validform({
		   tiptype: function(msg, o, cssctl){
			   if(!o.obj.is("form")){
				   var obj = o.obj.parent("td").find('tt');
				   cssctl(obj, o.type);
				   obj.text(msg);
			   }
		   },
		   datatype:{
			   "syj1-100": /^[\w-]{1,100}$/
		   },
		   ajaxPost:true,
		   callback:function (data){
				dialog.finish({
					content:data.msg,
					success:data.state,
					callback:function (){

						if(data.state){
							window.location.href='/admin/admin_project_list';
						}

					}
				})
		   }
		})
	})

</script>
</head>
<body>
	<div class="position_nav">你所在的当前位置：<?php echo $path_str;?> &gt; <?php echo $result['id']?'编辑项目':'添加项目' ;?></div>
		<div class="main">
			<form action="/handle.php" method="post" id='form1'>
			<input type="hidden" name="h" value="project/add">
			<input type="hidden" name="id" value="<?php echo $result['id']?>">
			<table  cellpadding="0" width="100%" cellspacing="1" border="0" class="table table_text">
			<tbody>
				<tr>
					<td width="13%" height="35" class="left">项目管理员：</td>
					<td width="87%">
					   <?php 
					     if(6==$cookie['group']){
					   ?>
						<select name='uid'>
							<option value="">请选择项目管理员</option>
							<?php
								foreach ($admin_list as $v){
									$selected = $v['id']==$result['uid']?'selected':'';
									echo "<option {$selected} value='{$v['id']}' >{$v['name']}</option>";
								}
							?>
						</select>
						<?php 
						}else{
						?>
						<strong><?php echo $cookie['name']?></strong>
						<input type="hidden" name="uid" value="<?php echo $cookie['id']?>">
						<?php 
						}
						?>
					</td>
				</tr>
				<tr>
					<td height="35" class="left">项目名称：</td>
					<td>
						<input type="text" class='w260' name='title' value="<?php echo $result['title'] ;?>" datatype='*1-100' errormsg='字符在1-100内' nullmsg='请输入项目名称'><span class='comment'></span><tt></tt>

					</td>
				</tr>
				<tr>
					<td height="35" class="left">项目开始时间：</td>
					<td>
						<input type="text" class='ipt4' id='dateimg' name='start_time' value="<?php echo $result['start_time']?date('Y-m-d H:i',$result['start_time']):'' ;?>" datatype='*' nullmsg='请选择项目开始时间' onclick='WdatePicker({isShowClear:false,readOnly:true,dateFmt:"yyyy-MM-dd HH:mm"})'><span class='comment'></span><tt></tt>

					</td>
				</tr>
				<tr>
					<td height="35" class="left">项目结束时间：</td>
					<td>
						<input type="text" class='ipt4' id='dateimg' name='end_time' value="<?php echo $result['end_time']?date('Y-m-d H:i',$result['end_time']):'' ;?>" datatype='*' nullmsg='请选择项目结束时间' onclick='WdatePicker({isShowClear:false,readOnly:true,dateFmt:"yyyy-MM-dd HH:mm"})'><span class='comment'></span><tt></tt>

					</td>
				</tr>
				<tr>
					<td height="35" class="left">项目地址：</td>
					<td>
						<input type="text" datatype='*1-150' nullmsg='请填写项目地址' class="w260" name="address" value="<?php echo $result['address'] ;?>"><span class='comment'>项目实施的详细地址</span><tt></tt>
					</td>
				</tr>
				<tr>
					<td height="35" class="left">计时模式间隔时间（分）：</td>
					<td>
						<input type="text" class="w260" name="time" value="<?php echo $result['time']?$result['time']:'' ;?>"><span class='comment'>默认为3分钟</span><tt></tt>
					</td>
				</tr>	
				<tr>
					<td height="35" class="left">装车模式标准间隔时间（秒）：</td>
					<td>
						<input type="text" class="w260" name="time_zc" value="<?php echo $result['time_zc']?$result['time_zc']:'' ;?>"><span class='comment'>默认为300秒</span><tt></tt>
					</td>
				</tr>								
				<tr>
					<td height="35" class="left">项目状态：</td>
					<td>
						<input type="radio" class="noborder" name='state' id='r1' value="1"<?php echo $result['state']==1||!isset($result['state'])?' checked ':'' ;?>><label for='r1'>开通</label>
						<input type="radio" name='state' class="noborder" id='r2' value="2" datatype="n" nullmsg="请选择性别" errormsg="请选择性别" <?php echo $result['state']==2?' checked ':'' ;?>><label for='r2'>关闭</label>

					</td>
				</tr>

				<tr>
					<td height="35"></td>
					<td>
						<input class="button1" type="submit" value="<?php echo $result['id']?'修改':'添加' ;?>">
					</td>
				</tr>
</tbody>
			</table>
			</form>
		</div>
	</div>
</body>
</html>




